<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="UTF-8" />
	<title>器材修改</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <link th:href="@{/static/css/right4.css}" rel="stylesheet">
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

	<div class="container bg-white">
       <div class="row">
            <form class="form-horizontal" th:if="${session.user.teacher_id eq null}" th:action="@{'/course/update/'+${currentPage}}" th:object="${course}" method="post">
             	<input type="hidden" id="id" name="id" th:value="${course.id}" />
             	<div style="border-left:#3399FF solid 2px; padding:10px;"><h4>修改课程计划</h4></div>
                <hr>
                 <div class="form-group">
                    <label for="" class="col-sm-3 control-label"> 课程名称</label>
                    <div class="col-sm-8">
                    	<input type="text" name="name" id="name" class="form-control" th:value="${course.name}"/>
                    </div>
                  </div>	
                 <div class="form-group">
                    <label for="" class="col-sm-3 control-label"> 教练名称</label>
                    <div class="col-sm-8">
                    	<select id="teacher_id" name="teacher_id" class="form-control">
		                    <option th:each="var : ${teacherList}" th:value="${var.id}" th:text="${var.username}" th:selected="${course.teacher_id==var.id}">Thymus Thymi</option>
		                </select>
                    </div>
                  </div>	
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程类型</label>
                    <div class="col-sm-8">
                      <input type="text" name="type" id="type" class="form-control" th:value="${course.type}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程开始时间</label>
                    <div class="col-sm-8">
                      <input type="text" name="startTime" id="startTime" class="form-control" th:value="${course.startTime}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程结束时间</label>
                    <div class="col-sm-8">
                      <input type="text" name="endTime" id="endTime" class="form-control" th:value="${course.endTime}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程预计人数</label>
                    <div class="col-sm-8">
                      <input type="text" name="count" id="count" class="form-control" th:value="${course.count}"/>
                    </div>
                  </div>
                <div class="form-group">    
                 <br>
                    <div class="col-sm-1 col-sm-offset-9 ">
                    	<button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
              </form>    
            <form class="form-horizontal" th:if="${session.user.teacher_id ne null}" th:action="@{'/course/update/'+${session.user.teacher_id}+'/'+${currentPage}}" th:object="${course}" method="post">
             	<input type="hidden" id="id" name="id" th:value="${course.id}" />
                <input type="hidden" id="teacher_id" name="teacher_id" th:value="${session.user.teacher_id}" />
             	<div style="border-left:#3399FF solid 2px; padding:10px;"><h4>修改课程计划</h4></div>
                <hr>
                 <div class="form-group">
                    <label for="" class="col-sm-3 control-label"> 课程名称</label>
                    <div class="col-sm-8">
                    	<input type="text" name="name" id="name" class="form-control" th:value="${course.name}"/>
                    </div>
                  </div>	
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程类型</label>
                    <div class="col-sm-8">
                      <input type="text" name="type" id="type" class="form-control" th:value="${course.type}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程开始时间</label>
                    <div class="col-sm-8">
                      <input type="text" name="startTime" id="startTime" class="form-control" th:value="${course.startTime}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程结束时间</label>
                    <div class="col-sm-8">
                      <input type="text" name="endTime" id="endTime" class="form-control" th:value="${course.endTime}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">课程预计人数</label>
                    <div class="col-sm-8">
                      <input type="text" name="count" id="count" class="form-control" th:value="${course.count}"/>
                    </div>
                  </div>
                <div class="form-group">    
                 <br>
                    <div class="col-sm-1 col-sm-offset-9 ">
                    	<button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
              </form>    
       	</div>
       </div>
	<script th:src="@{/static/js/jquery-2.1.4.js}"></script>
</body>
</html>